
<div class="pop-box">
	<div class="head clearfix">
		<a href="javascript:history.go(-1)" class="iconfont icon-zuo"></a>
		<span class="head-name">会议室面板</span>
		<a href="#" class="text-right sure">确定</a>
	</div>
	<div class="form-box">
		<p class="form-list clearfix">
			<span class="field">预约日期:</span>
			<input id="time" placeholder="请选择时间"/>
		</p>
		<p class="form-list clearfix">
			<span class="field">会议室名称:</span>
			<input id="room_name" name="room_name" placeholder="请输入会议室名称" value=""/>
		</p>
	</div>
	<div class="lists">
		<p class="title">会议室类型</p>
		<div class="label-box text-12 clearfix type">
			<a href="javascript:void(0)" class="label actived">全部</a>
			<a href="javascript:void(0)" class="label">大型会议室</a>
			<a href="javascript:void(0)" class="label">中型会议室</a>
			<a href="javascript:void(0)" class="label">小型会议室</a>
			<a href="javascript:void(0)" class="label">报告厅</a>
			<a href="javascript:void(0)" class="label">教室</a>
		</div>
	</div>
	<div class="lists">
		<p class="title">会议室区域</p>
		<div class="label-box text-12 clearfix area">
			<a href="#" class="label actived">全部</a>
			<a href="#" class="label">下沙</a>
			<a href="#" class="label">仓前</a>
		</div>
	</div>
</div>


<script>
	$(document).on('click','.filter',function() {
		$('.pop-box').show();
	})

	$(document).on('click','.sure',function() {
		var time = $("#time").val();  //预约日期
		var room_name = $("input[name='room_name']").val();
		var room_type = $(".type .actived").index();
		var area = $(".area .actived").index();
		var account_id = $(".filter").data('account_id');
		$.ajax({
			url: '/meeting/meetingRoom/meetingSelect/account_id/' + account_id,
			type: 'post',
			data: {select_time:time,room_name:room_name,room_type:room_type,area:area},
			dataType: 'json',
			success:function(data){
				if(data.status == 'S'){
					var str = "";
					if(data.select_time){
						str += '/select_time/' + data.select_time;
					}
					if(data.data.room_type){
						str += '/room_type/' + data.data.room_type;
					}
					if(data.data.room_name){
						str += '/room_name/' + data.data.room_name;
					}
					if(data.data.area){
						str += '/area/' + data.data.area;
					}
					location.href = '/meeting/MeetingInvite/addInviteMeeting/account_id/' + account_id + '/step/four' +str ;
				}
				if(data.status == 'F'){
					var str = "";
					if(data.select_time){
						str += '/select_time/' + data.select_time;
					}
					if(data.data.room_type){
						str += '/room_type/' + data.data.room_type;
					}
					if(data.data.room_name){
						str += '/room_name/' + data.data.room_name;
					}
					if(data.data.area){
						str += '/area/' + data.data.area;
					}
					location.href = '/meeting/MeetingInvite/addInviteMeeting/account_id/' + account_id + '/step/four' +str ;
				}
			},error:function(){
				location.href = '/meeting/MeetingInvite/addInviteMeeting/account_id/' + account_id;
			}
		});
	})

	$(".type a.label").click(function(){
		$(this).addClass('actived').siblings().removeClass('actived');
	});

	$(".area a.label").click(function(){
		$(this).addClass('actived').siblings().removeClass('actived');
	});
</script>